#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

class BigInt
{
public:
    int value, count1, count2;
    BigInt(): value(0), count1(0), count2(0){}
    void add(BigInt &a)
    {
        count1 += a.count1;
        count2 += a.count2;
        value += a.value;

        if (value < 0) {
            count1++;
            value = value - (1L << 31);
        }
        
        if (count1 < 0) {
            count2++;
            count1 -= (1L << 31);
        }
    }

    void add(int num)
    {
        value += num;

        if (value < 0) {
            count1++;
            value = value - (1L << 31);
        }
        
        if (count1 < 0) {
            count2++;
            count1 -= (1L << 31);
        }
    }
    void clear()
    {
        value = 0;
        count1 = 0;
        count2 = 0;
    }

    friend ostream& operator<<(ostream& os, const BigInt& num)
    {
        os << num.count2 << " " << num.count1 << " " << num.value << endl;
        return os;
    }
};


int main(int argc, char **argv)
{
    cout << "-----------------Test 1--------------------" << endl;
    BigInt a, b;
    a.value = 0x7fffffff;
    cout << a << endl;
    a.add(1);
    cout << a << endl;


    cout << "-----------------Test 2--------------------" << endl;


    cout << "-----------------Test 3--------------------" << endl;


    cout << "-----------------Test 4--------------------" << endl;


    cout << "-----------------Test 5--------------------" << endl;



}
